<template>
  <el-main>
    <el-table :data="datass.list" stripe border max-height="500">
      <slot name="input"></slot>
      <el-table-column prop="id" label="设备编号" width="140">
      </el-table-column>
      <el-table-column prop="name" label="设备名称" width="100">
      </el-table-column>
      <el-table-column prop="status" label="设备状态" width="120">
        <template slot-scope="scope">
          <span v-if="scope.row.status === 'STATUS1'" style="background: yellow"
            >未审核</span
          >
          <span
            v-else-if="scope.row.status === 'STATUS3'"
            style="background: red"
            >未使用</span
          >
          <span
            v-else-if="scope.row.status === 'STATUS4'"
            style="background: rgb(0, 17, 255)"
            >使用中</span
          >
          <span
            v-else-if="scope.row.status === 'STATUS5'"
            style="background: rgb(174, 0, 255)"
            >维修中</span
          >
          <span
            v-else-if="scope.row.status === 'STATUS6'"
            style="background: yellow"
            >报废中</span
          >
          <span v-else style="background: red">已审核</span>
        </template>
      </el-table-column>
      <el-table-column prop="category" label="设备分类" width="130">
      </el-table-column>
      <el-table-column prop="number" label="数量" width="120">
      </el-table-column>
      <el-table-column prop="price" label="单价" width="120"> </el-table-column>
      <el-table-column prop="time" label="限购日期" width="140">
      </el-table-column>
      <slot name="caozuo"></slot>

      <!-- <el-table-column prop="zip" label="操作" width="220">
        <template slot-scope="scope">
          <el-button @click="handleClick(scope.row)" type="text" size="small"
            >详情</el-button
          >
          <el-button
            type="primary"
            size="small"
            v-if="scope.row.status === 'STATUS1'"
            >编辑</el-button
          >
          <el-button type="primary" size="small" v-else>入库</el-button>

          <el-button
            type="primary"
            @click="shenhe(scope.row)"
            size="small"
            v-if="scope.row.status === 'STATUS1'"
            >审核</el-button
          >
        </template>
      </el-table-column> -->
    </el-table>

    <div class="block">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="1"
        :page-sizes="[15, 20, 25]"
        :page-size="100"
        layout="total, sizes, prev, pager, next, jumper"
        :total="datass.total"
      >
      </el-pagination>
    </div>
  </el-main>
</template>

<script>
export default {
  name: "MainView",
  props: ["datass", "getnumbers", "getpages"],
  data() {
    return {};
  },
  methods: {
    handleSizeChange(val) {
      // this.todata.pageSize = `${val}`;
      this.getnumbers(`${val}`);
    },
    handleCurrentChange(val) {
      // this.todata.pageNo = `${val}`;
      this.getpages(`${val}`);
    },
  },
  created() {},
  mounted() {
    console.log(this.datass);
  },
};
</script>

<style>
</style>